package com.dwd.hrm.client;

import com.dwd.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Description: TODO
 * @Author 汶狄
 * @Date 2021/3/15 10:20
 * @Version 1.0
 */
@Component
public class SystemClientFactory implements FallbackFactory<SystemClient> {
    @Override
    public SystemClient create(Throwable throwable) {
        return new SystemClient() {
            @Override
            public AjaxResult loginInfo(Long loginId) {
                throwable.printStackTrace();
                return AjaxResult.me().setSuccess(false).setMessage("查询错误" + throwable.getMessage());
            }
        };
    }
}
